
<!DOCTYPE HTML>
<html lang="zh" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>用户秤 · GitBook</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        
        
        
    
    
    <link rel="stylesheet" href="../../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-mermaid-gb3/mermaid/mermaid.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    


    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="ble_ruler.html" />
    
    
    <link rel="prev" href="kitchen_scale.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="輸入並搜尋" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    概述
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="../guide/android.html">
            
                <a href="../guide/android.html">
            
                    
                    android
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="../guide/ios.html">
            
                <a href="../guide/ios.html">
            
                    
                    ios
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4" >
            
                <span>
            
                    
                    工作流程
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="ble_scale.html">
            
                <a href="ble_scale.html">
            
                    
                    普通蓝牙秤
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="ble_scale_custom_connect.html">
            
                <a href="ble_scale_custom_connect.html">
            
                    
                    普通蓝牙秤-自主管理蓝牙
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.3" data-path="kitchen_scale.html">
            
                <a href="kitchen_scale.html">
            
                    
                    厨房秤
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.4.4" data-path="ble_user_scale.html">
            
                <a href="ble_user_scale.html">
            
                    
                    用户秤
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.5" data-path="ble_ruler.html">
            
                <a href="ble_ruler.html">
            
                    
                    蓝牙围度尺
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" >
            
                <span>
            
                    
                    API
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="../api/QNBleApi.html">
            
                <a href="../api/QNBleApi.html">
            
                    
                    QNBleApi
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1.1" data-path="../api/QNBleApi.html">
            
                <a href="../api/QNBleApi.html#initsdk">
            
                    
                    initSdk
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.1.2" data-path="../api/QNBleApi.html">
            
                <a href="../api/QNBleApi.html#getcursystemblestate">
            
                    
                    getCurSystemBleState
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.1.3" data-path="../api/QNBleApi.html">
            
                <a href="../api/QNBleApi.html#setsysblestatelistener">
            
                    
                    setSysBleStateListener
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.1.4" data-path="../api/QNBleApi.html">
            
                <a href="../api/QNBleApi.html#setbledevicediscoverylistener">
            
                    
                    setBleDeviceDiscoveryListener
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.1.5" data-path="../api/QNBleApi.html">
            
                <a href="../api/QNBleApi.html#setbleconnectionchangelistener">
            
                    
                    setBleConnectionChangeListener
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.1.6" data-path="../api/QNBleApi.html">
            
                <a href="../api/QNBleApi.html#setdataListener">
            
                    
                    setDataListener
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.1.7" data-path="../api/QNBleApi.html">
            
                <a href="../api/QNBleApi.html#setblekitchenlistener">
            
                    
                    setBleKitchenListener
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.1.8" data-path="../api/QNBleApi.html">
            
                <a href="../api/QNBleApi.html#setloglistener">
            
                    
                    setLogListener
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.1.9" data-path="../api/QNBleApi.html">
            
                <a href="../api/QNBleApi.html#startbledevicediscovery">
            
                    
                    startBleDeviceDiscovery
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.1.10" data-path="../api/QNBleApi.html">
            
                <a href="../api/QNBleApi.html#stopbledevicediscovery">
            
                    
                    stopBleDeviceDiscovery
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.1.11" data-path="../api/QNBleApi.html">
            
                <a href="../api/QNBleApi.html#connectdevice">
            
                    
                    connectDevice
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.1.12" data-path="../api/QNBleApi.html">
            
                <a href="../api/QNBleApi.html#connectuserscaledevice">
            
                    
                    connectUserScaleDevice
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.1.13" data-path="../api/QNBleApi.html">
            
                <a href="../api/QNBleApi.html#connectblekitchendevice">
            
                    
                    connectBleKitchenDevice
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.1.14" data-path="../api/QNBleApi.html">
            
                <a href="../api/QNBleApi.html#setblekitchendeviceconfig">
            
                    
                    setBleKitchenDeviceConfig
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.1.15" data-path="../api/QNBleApi.html">
            
                <a href="../api/QNBleApi.html#disconnectdevice">
            
                    
                    disconnectDevice
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.1.16" data-path="../api/QNBleApi.html">
            
                <a href="../api/QNBleApi.html#getconfig">
            
                    
                    getConfig
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.1.17" data-path="../api/QNBleApi.html">
            
                <a href="../api/QNBleApi.html#convertweightwithtargetunit">
            
                    
                    convertWeightWithTargetUnit
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.1.18" data-path="../api/QNBleApi.html">
            
                <a href="../api/QNBleApi.html#builddevice">
            
                    
                    buildDevice
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.1.19" data-path="../api/QNBleApi.html">
            
                <a href="../api/QNBleApi.html#buildprotocolhandler">
            
                    
                    buildProtocolHandler
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.1.20" data-path="../api/QNBleApi.html">
            
                <a href="../api/QNBleApi.html#generatescaledata">
            
                    
                    generateScaleData
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.1.21" data-path="../api/QNBleApi.html">
            
                <a href="../api/QNBleApi.html#physiquecalculation">
            
                    
                    physiqueCalculation
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.1.22" data-path="../api/QNBleApi.html">
            
                <a href="../api/QNBleApi.html#switchuserscaleuser">
            
                    
                    switchUserScaleUser
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.1.23" data-path="../api/QNBleApi.html">
            
                <a href="../api/QNBleApi.html#updateuserscaleidentifyweight">
            
                    
                    updateUserScaleIdentifyWeight
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.1.24" data-path="../api/QNBleApi.html">
            
                <a href="../api/QNBleApi.html#deletescaleusers">
            
                    
                    deleteScaleUsers
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.1.25" data-path="../api/QNBleApi.html">
            
                <a href="../api/QNBleApi.html#setblerulerlistener">
            
                    
                    setBleRulerListener
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.1.26" data-path="../api/QNBleApi.html">
            
                <a href="../api/QNBleApi.html#connectrulerdevice">
            
                    
                    connectRulerDevice
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5.2" data-path="../api/QNUser.html">
            
                <a href="../api/QNUser.html">
            
                    
                    QNUser
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.3" data-path="../api/QNScaleData.html">
            
                <a href="../api/QNScaleData.html">
            
                    
                    QNScaleData
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.4" data-path="../api/QNScaleStoreData.html">
            
                <a href="../api/QNScaleStoreData.html">
            
                    
                    QNScaleStoreData
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.5" data-path="../api/QNScaleItemData.html">
            
                <a href="../api/QNScaleItemData.html">
            
                    
                    QNScaleItemData
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.6" data-path="../api/QNBleDevice.html">
            
                <a href="../api/QNBleDevice.html">
            
                    
                    QNBleDevice
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.7" data-path="../api/QNBleBroadcastDevice.html">
            
                <a href="../api/QNBleBroadcastDevice.html">
            
                    
                    QNBleBroadcastDevice
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.8" data-path="../api/QNBleKitchenDevice.html">
            
                <a href="../api/QNBleKitchenDevice.html">
            
                    
                    QNBleKitchenDevice
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.9" data-path="../api/QNConfig.html">
            
                <a href="../api/QNConfig.html">
            
                    
                    QNConfig
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.10" data-path="../api/QNWiFiConfig.html">
            
                <a href="../api/QNWiFiConfig.html">
            
                    
                    QNWiFiConfig
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.11" data-path="../api/QNUserScaleConfig.html">
            
                <a href="../api/QNUserScaleConfig.html">
            
                    
                    QNUserScaleConfig
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.12" data-path="../api/QNBleKitchenConfig.html">
            
                <a href="../api/QNBleKitchenConfig.html">
            
                    
                    QNBleKitchenConfig
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.13" data-path="../api/QNBleStateListener.html">
            
                <a href="../api/QNBleStateListener.html">
            
                    
                    QNBleStateListener
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.14" data-path="../api/QNBleDeviceDiscoveryListener.html">
            
                <a href="../api/QNBleDeviceDiscoveryListener.html">
            
                    
                    QNBleDeviceDiscoveryListener
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.15" data-path="../api/QNBleConnectionChangeListener.html">
            
                <a href="../api/QNBleConnectionChangeListener.html">
            
                    
                    QNBleConnectionChangeListener
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.16" data-path="../api/QNScaleDataListener.html">
            
                <a href="../api/QNScaleDataListener.html">
            
                    
                    QNScaleDataListener
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.17" data-path="../api/QNUserScaleDataListener.html">
            
                <a href="../api/QNUserScaleDataListener.html">
            
                    
                    QNUserScaleDataListener
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.18" data-path="../api/QNBleKitchenListener.html">
            
                <a href="../api/QNBleKitchenListener.html">
            
                    
                    QNBleKitchenListener
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.19" data-path="../api/QNLogListener.html">
            
                <a href="../api/QNLogListener.html">
            
                    
                    QNLogListener
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.20" data-path="../api/QNResultCallback.html">
            
                <a href="../api/QNResultCallback.html">
            
                    
                    QNResultCallback
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.21" data-path="../api/QNShareData.html">
            
                <a href="../api/QNShareData.html">
            
                    
                    QNShareData
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.22" data-path="../api/QNUtils.html">
            
                <a href="../api/QNUtils.html">
            
                    
                    QNUtils
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.23" data-path="../api/QNBleProtocolHandler.html">
            
                <a href="../api/QNBleProtocolHandler.html">
            
                    
                    QNBleProtocolHandler
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.24" data-path="../api/QNBleProtocolDelegate.html">
            
                <a href="../api/QNBleProtocolDelegate.html">
            
                    
                    QNBleProtocolDelegate
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.25" data-path="../api/QNWspScaleDataListener.html">
            
                <a href="../api/QNWspScaleDataListener.html">
            
                    
                    QNWspScaleDataListener
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.26" data-path="../api/QNBleRulerDevice.html">
            
                <a href="../api/QNBleRulerDevice.html">
            
                    
                    QNBleRulerDevice
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.27" data-path="../api/QNBleRulerData.html">
            
                <a href="../api/QNBleRulerData.html">
            
                    
                    QNBleRulerData
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.28" data-path="../api/QNBleRulerListener.html">
            
                <a href="../api/QNBleRulerListener.html">
            
                    
                    QNBleRulerListener
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" >
            
                <span>
            
                    
                    附表
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.1" data-path="../attouched_list/faq.html">
            
                <a href="../attouched_list/faq.html">
            
                    
                    常见问题
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2" data-path="../attouched_list/body_indexes.html">
            
                <a href="../attouched_list/body_indexes.html">
            
                    
                    身体指标常量
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.3" data-path="../attouched_list/device_type.html">
            
                <a href="../attouched_list/device_type.html">
            
                    
                    设备类型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.4" data-path="../attouched_list/display_module_type.html">
            
                <a href="../attouched_list/display_module_type.html">
            
                    
                    显示模块类型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.5" data-path="../attouched_list/body_shape.html">
            
                <a href="../attouched_list/body_shape.html">
            
                    
                    体型对照表
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.6" data-path="../attouched_list/error_code.html">
            
                <a href="../attouched_list/error_code.html">
            
                    
                    错误码
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.7" data-path="../attouched_list/scan_error.html">
            
                <a href="../attouched_list/scan_error.html">
            
                    
                    扫描错误码
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.8" data-path="../attouched_list/scale_state.html">
            
                <a href="../attouched_list/scale_state.html">
            
                    
                    秤状态定义
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.9" data-path="../attouched_list/scale_event.html">
            
                <a href="../attouched_list/scale_event.html">
            
                    
                    秤事件定义
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.10" data-path="../attouched_list/area_type.html">
            
                <a href="../attouched_list/area_type.html">
            
                    
                    区域类型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.11" data-path="../attouched_list/test_list.html">
            
                <a href="../attouched_list/test_list.html">
            
                    
                    测试用例
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.12" data-path="../attouched_list/policy.html">
            
                <a href="../attouched_list/policy.html">
            
                    
                    隐私协议
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.13" data-path="../history/history.html">
            
                <a href="../history/history.html">
            
                    
                    更新日志
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            本書使用 GitBook 釋出
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >用户秤</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h1 id="&#x7528;&#x6237;&#x79E4;">&#x7528;&#x6237;&#x79E4;</h1>
<p>&#x7528;&#x6237;&#x79E4;&#x662F;&#x6211;&#x53F8;&#x63A8;&#x51FA;&#x7684;&#x4E00;&#x6B3E;&#x652F;&#x6301;&#x76F4;&#x63A5;&#x5728;&#x79E4;&#x663E;&#x793A;&#x5C4F;&#x4E0A;&#x5C55;&#x793A;&#x6D4B;&#x91CF;&#x7ED3;&#x679C;&#x667A;&#x80FD;&#x8BBE;&#x5907;&#x3002;&#x7528;&#x6237;&#x53EF;&#x4EE5;&#x5728;&#x6CE8;&#x518C;&#x79E4;&#x7AEF;&#x7528;&#x6237;&#x4E0B;,&#x8131;&#x79BB;APP&#x79F0;&#x91CF;&#x540E;&#x5728;&#x79E4;&#x7AEF;&#x663E;&#x793A;&#x6D4B;&#x91CF;&#x6570;&#x636E;&#x7ED3;&#x679C;,&#x63D0;&#x5347;&#x7528;&#x6237;&#x4F53;&#x9A8C;&#x3002;
&#x7528;&#x6237;&#x79E4;&#x4ECE;&#x901A;&#x4FE1;&#x65B9;&#x5F0F;&#x4E0A;&#x5206;&#x4E3A;&#x84DD;&#x7259;&#x79E4;&#x4E0E;&#x84DD;&#x7259;WiFi&#x53CC;&#x6A21;&#x79E4;&#x3002;&#x5728;&#x4F7F;&#x7528;&#x4E0A;,&#x4E24;&#x6B3E;&#x8BBE;&#x5907;&#x5728;&#x84DD;&#x7259;&#x6A21;&#x5F0F;&#x4E0B;&#x5DE5;&#x4F5C;&#x6A21;&#x5F0F;&#x662F;&#x76F8;&#x540C;&#x7684;&#x3002;&#x84DD;&#x7259;WiFi&#x53CC;&#x6A21;&#x79E4;&#x4F1A;&#x76F8;&#x8F83;&#x84DD;&#x7259;&#x6B3E;&#x4F1A;&#x591A;&#x51FA;WiFi&#x6A21;&#x5F0F;&#x4E0B;&#x6D4B;&#x91CF;&#x7B49;&#x529F;&#x80FD;&#x3002;
&#x9488;&#x5BF9;&#x84DD;&#x7259;WiFi&#x53CC;&#x6A21;&#x79E4;&#x9664;&#x4E86;&#x4F7F;&#x7528;&#x84DD;&#x7259;&#x529F;&#x80FD;&#x9700;&#x8981;&#x5BF9;&#x63A5;SDK&#x5916;,&#x8FD8;&#x9700;&#x8981;&#x914D;&#x5408;&#x670D;&#x52A1;&#x5668;&#x96C6;&#x6210;<a href="https://github.com/YolandaQingniu/qn_wsp_full_server_doc/blob/main/README.zh-CN.md" target="_blank">Docker</a>&#x3002;</p>
<h2 id="&#x4F7F;&#x7528;&#x6D4B;&#x91CF;&#x7B80;&#x8FF0;">&#x4F7F;&#x7528;&#x6D4B;&#x91CF;&#x7B80;&#x8FF0;</h2>
<p>&#x5728;&#x79E4;&#x4E0E;APP&#x901A;&#x8FC7;&#x84DD;&#x7259;&#x8FDE;&#x63A5;&#x540E;,APP&#x5411;&#x79E4;&#x8F93;&#x9001;&#x672C;&#x6B21;&#x6D4B;&#x91CF;&#x7528;&#x6237;&#x7684;&#x57FA;&#x672C;&#x4FE1;&#x606F;&#x3002;&#x672C;&#x6B21;&#x6D4B;&#x91CF;&#x5B8C;&#x6210;&#x65F6;&#xFF0C;&#x79E4;&#x7AEF;&#x4F1A;&#x663E;&#x793A;&#x672C;&#x6B21;&#x6D4B;&#x91CF;&#x7ED3;&#x679C;&#x5E76;&#x5C06;&#x6D4B;&#x91CF;&#x6570;&#x636E;&#x8BE6;&#x60C5;&#x4E0A;&#x4F20;&#x5230;APP&#x4E2D;&#x3002;</p>
<p>&#x76EE;&#x524D; &#x7528;&#x6237;&#x79E4;&#x8BBE;&#x5907;&#x6700;&#x591A;&#x5141;&#x8BB8;&#x5B58;&#x50A8; 8 &#x4F4D;&#x7528;&#x6237;&#x4FE1;&#x606F;&#xFF0C;&#x79E4;&#x7AEF;&#x7684;&#x7528;&#x6237;&#x9700;&#x8981;&#x901A;&#x8FC7;&#x84DD;&#x7259;&#x8FDE;&#x63A5;&#x7684;&#x65B9;&#x5F0F;&#x5411;&#x8BBE;&#x5907;&#x6CE8;&#x518C;&#x7528;&#x6237;&#x3002;&#x5F53;&#x6CE8;&#x518C;&#x6EE1; 8 &#x4E2A;&#x7528;&#x6237;&#x540E;&#xFF0C;&#x518D;&#x6B21;&#x5411;&#x8BBE;&#x5907;&#x6CE8;&#x518C;&#x7528;&#x6237;&#x65F6;&#xFF0C;&#x79E4;&#x7AEF;&#x4F1A;&#x8FD4;&#x56DE;&#x6CE8;&#x518C;&#x5931;&#x8D25;&#x7684;&#x72B6;&#x6001;&#x3002;&#x56E0;&#x6B64;&#x5EFA;&#x8BAE;&#x60A8;&#x6CE8;&#x518C;&#x7528;&#x6237;&#x4E4B;&#x524D;&#xFF0C;&#x4E0B;&#x53D1;&#x79E4;&#x7AEF;&#x5DF2;&#x6CE8;&#x518C;&#x7528;&#x6237;&#x5217;&#x8868;&#xFF0C;&#x4EE5;&#x907F;&#x514D;&#x65E0;&#x6548;&#x7528;&#x6237;&#x5360;&#x636E;&#x8D44;&#x6E90;&#x3002;</p>
<p>&#x5F53;&#x5411;&#x8BBE;&#x5907;&#x6CE8;&#x518C;&#x7528;&#x6237;&#x65F6;&#xFF0C;&#x6CE8;&#x518C;&#x6210;&#x529F;&#x65F6;&#xFF0C;&#x8BBE;&#x5907;&#x4F1A;&#x8BB0;&#x5F55;&#x8BE5;&#x7528;&#x6237;&#x79D8;&#x94A5;(&#x975E;&#x5FC5;&#x4F20;)&#x540C;&#x65F6;&#x8FD4;&#x56DE;&#x8BE5;&#x7528;&#x6237;&#x7684;&#x552F;&#x4E00;&#x5E8F;&#x5217;&#x53F7;&#x3002;&#x56E0;&#x6B64;&#x6CE8;&#x518C;&#x8BE5;&#x7528;&#x6237;&#x6210;&#x529F;&#x540E;&#xFF0C;app &#x9700;&#x8981;&#x5C06;&#x8BBE;&#x5907;&#x8FD4;&#x56DE;&#x8BE5;&#x7528;&#x6237;&#x7684;&#x5E8F;&#x5217;&#x53F7;&#x4FDD;&#x5B58;&#x8D77;&#x6765;&#x3002;&#x5F53;&#x901A;&#x8FC7;&#x84DD;&#x7259;&#x8FDE;&#x63A5;&#x66F4;&#x65B0;&#x7528;&#x6237;&#x8D44;&#x6599;&#x6216;&#x7528;&#x6237;&#x901A;&#x8FC7;&#x84DD;&#x7259;&#x8FDE;&#x63A5;&#x6D4B;&#x91CF;&#x65F6;&#xFF0C;&#x9700;&#x8981;&#x5148;&#x4F7F;&#x7528;&#x7528;&#x6237;&#x5E8F;&#x5217;&#x53F7;&#x8BBF;&#x95EE;&#x79E4;&#x7AEF;&#x7684;&#x6307;&#x5B9A;&#x7528;&#x6237;&#x6210;&#x529F;&#x540E;&#x624D;&#x80FD;&#x8FDB;&#x884C;&#x3002;&#x540C;&#x65F6;&#x5E8F;&#x5217;&#x53F7;&#x4E5F;&#x662F;&#x4F5C;&#x4E3A;&#x8BBE;&#x5907;&#x4E0A;&#x4F20;&#x6D4B;&#x91CF;&#x6570;&#x636E;&#x5C5E;&#x4E8E;&#x54EA;&#x4E2A;&#x6CE8;&#x518C;&#x7528;&#x6237;&#x7684;&#x6807;&#x8BC6;&#xFF0C;&#x4EE5;&#x53CA;&#x4F5C;&#x4E3A;&#x5220;&#x9664;&#x7528;&#x6237;&#x7684;&#x5FC5;&#x8981;&#x6761;&#x4EF6;&#x3002;</p>
<ul>
<li><p>&#x6CE8;&#x518C;&#x7528;&#x6237;</p>
<p>&#x79E4;&#x7AEF;&#x80FD;&#x7F13;&#x5B58;&#x5DF2;&#x7ECF;&#x6CE8;&#x518C;&#x7684;&#x7528;&#x6237;&#x4FE1;&#x606F;&#xFF0C;&#x901A;&#x8FC7;&#x5DF2;&#x7ECF;&#x6CE8;&#x518C;&#x7684;&#x7528;&#x6237;&#x4FE1;&#x606F;&#x8BC6;&#x522B;&#x672A;&#x8FDE;&#x63A5;&#x84DD;&#x7259;&#x65F6;&#x7684;&#x6D4B;&#x91CF;&#x6570;&#x636E;&#x5C5E;&#x4E8E;&#x54EA;&#x4E2A;&#x7528;&#x6237;&#xFF0C;&#x4ECE;&#x800C;&#x4F7F;&#x7528;&#x8BC6;&#x522B;&#x5230;&#x7684;&#x7528;&#x6237;&#x4FE1;&#x606F;&#x83B7;&#x53D6;&#x8BE6;&#x7EC6;&#x6D4B;&#x91CF;&#x6570;&#x636E;</p>
</li>
<li><p>&#x8BBF;&#x95EE;&#x7528;&#x6237;</p>
<p>&#x5BF9;&#x79E4;&#x8FDB;&#x884C;&#x64CD;&#x4F5C;&#x65F6;&#x90FD;&#x9700;&#x8981;&#x5148;&#x8BBF;&#x95EE;&#x5DF2;&#x6CE8;&#x518C;&#x7684;&#x7528;&#x6237;&#xFF0C;&#x8BBF;&#x95EE;&#x6210;&#x529F;&#x540E;&#x624D;&#x80FD;&#x8FDB;&#x76F8;&#x5E94;&#x7684;&#x64CD;&#x4F5C;&#xFF0C;&#x6BD4;&#x5982;&#x4FEE;&#x6539;&#x7528;&#x6237;&#x4FE1;&#x606F;&#x3001;&#x8FDE;&#x63A5;&#x84DD;&#x7259;&#x8FDB;&#x884C;&#x6D4B;&#x91CF;&#x7B49;</p>
</li>
</ul>
<h2 id="&#x8BBF;&#x5BA2;&#x6A21;&#x5F0F;&#x6D4B;&#x91CF;">&#x8BBF;&#x5BA2;&#x6A21;&#x5F0F;&#x6D4B;&#x91CF;</h2>
<p>&#x8BBF;&#x5BA2;&#x6A21;&#x5F0F;&#x662F;&#x79E4;&#x4F53;&#x63D0;&#x4F9B;&#x7684;&#x4E00;&#x4E2A;&#x516C;&#x5171;&#x901A;&#x9053;&#x7684;&#x6D4B;&#x91CF;&#x65B9;&#x5F0F;&#xFF0C;&#x8BE5;&#x65B9;&#x5F0F;&#x65E0;&#x9700;&#x6CE8;&#x518C;&#x7528;&#x6237;&#x76F4;&#x63A5;&#x4F7F;&#x7528;&#xFF0C;&#x8BBF;&#x5BA2;&#x6A21;&#x5F0F;&#x4F7F;&#x7528;&#x7684;&#x662F;&#x4E34;&#x65F6;&#x7528;&#x6237;&#xFF0C;&#x8BE5;&#x7528;&#x6237;&#x7684;&#x5B58;&#x5728;&#x65F6;&#x95F4;&#x4E3A;&#x4ECE;&#x8FDE;&#x63A5;&#x5230;&#x65AD;&#x5F00;&#xFF0C;&#x5F53;&#x8BBE;&#x5907;&#x65AD;&#x5F00;&#x8FDE;&#x63A5;&#x65F6;&#x4E34;&#x65F6;&#x7528;&#x6237;&#x5373;&#x9500;&#x6BC1;&#xFF0C;&#x540C;&#x65F6;&#x5728;&#x8BBF;&#x5BA2;&#x6A21;&#x5F0F;&#x4E0B;&#x4E0D;&#x4F1A;&#x4EA7;&#x751F;&#x4E0E;&#x63A5;&#x6536;&#x5B58;&#x50A8;&#x6570;&#x636E;</p>
<h2 id="&#x8BBE;&#x5907;&#x534F;&#x8BAE;&#x7B80;&#x8FF0;">&#x8BBE;&#x5907;&#x534F;&#x8BAE;&#x7B80;&#x8FF0;</h2>
<p>&#x534F;&#x8BAE;&#x6D89;&#x53CA;&#x7684;&#x65B9;&#x9762;&#xFF1A;</p>
<ul>
<li>&#x7528;&#x6237;&#x65B9;&#x9762;<ul>
<li>&#x5E74;&#x9F84;</li>
<li>&#x8EAB;&#x9AD8;</li>
<li>&#x6027;&#x522B;</li>
</ul>
</li>
<li>&#x6D4B;&#x91CF;&#x65B9;&#x9762;<ul>
<li>&#x6D4B;&#x91CF;&#x72B6;&#x6001;</li>
<li>&#x5B9E;&#x65F6;&#x4F53;&#x91CD;VA</li>
<li>&#x5B58;&#x50A8;&#x6570;&#x636E;</li>
<li>&#x6D4B;&#x91CF;&#x6570;&#x636E;</li>
</ul>
</li>
<li>&#x5176;&#x4ED6;<ul>
<li>&#x5355;&#x4F4D;</li>
</ul>
</li>
</ul>
<p>&#x8BE5;&#x8BBE;&#x5907;&#x7684;&#x6D89;&#x53CA;&#x7684;&#x65B9;&#x9762;&#x6BD4;&#x8F83;&#x591A;&#xFF0C;&#x5E76;&#x4E14;&#x534F;&#x8BAE;&#x4E4B;&#x95F4;&#x7684;&#x901A;&#x8BAF;&#x8FC7;&#x7A0B;&#x4EE5;&#x53CA;&#x4F7F;&#x80FD;&#x65B9;&#x5F0F;&#x90FD;&#x8981;&#x4E25;&#x683C;&#x7684;&#x8981;&#x6C42;&#xFF0C;&#x6211;&#x53F8;&#x76EE;&#x524D;&#x5DF2;&#x7ECF;&#x5C06;&#x5176;&#x5C01;&#x88C5;&#x6210; SDK &#x65B9;&#x4FBF;&#x63A5;&#x5165;&#x4F7F;&#x7528;&#x3002;</p>
<h2 id="&#x4E0D;&#x540C;&#x60C5;&#x51B5;&#x4E0B;&#x7684;&#x5DE5;&#x4F5C;&#x6D41;&#x7A0B;">&#x4E0D;&#x540C;&#x60C5;&#x51B5;&#x4E0B;&#x7684;&#x5DE5;&#x4F5C;&#x6D41;&#x7A0B;</h2>
<p> <img src="../images/firstUseOfBindingNetwork.png" alt=""></p>
<p> <img src="../images/connectBluetoothMeasurement.png" alt=""></p>
<p> <img src="../images/distributionNetwork.png" alt=""></p>
<p> <img src="../images/connectWiFiMeasurement.png" alt=""></p>
<p> <img src="../images/connectWiFiUnknownMeasurement.png" alt=""></p>
<h2 id="&#x5177;&#x4F53;&#x63A5;&#x5165;&#x8BBE;&#x5907;&#x5B9E;&#x73B0;">&#x5177;&#x4F53;&#x63A5;&#x5165;&#x8BBE;&#x5907;&#x5B9E;&#x73B0;</h2>
<h3 id="&#x4E00;&#x3001;&#x521D;&#x59CB;&#x5316;qnsdk">&#x4E00;&#x3001;&#x521D;&#x59CB;&#x5316;QNSDK</h3>
<p>&#x4F7F;&#x7528;<a href="../api/QNBleApi.html#initSdk">QNBleApi.initSdk</a>&#x8FDB;&#x884C;&#x521D;&#x59CB;&#x5316;QNSDK&#x3002;</p>
<h3 id="&#x4E8C;&#x3001;&#x8BBE;&#x7F6E;&#x76D1;&#x542C;&#x5668;">&#x4E8C;&#x3001;&#x8BBE;&#x7F6E;&#x76D1;&#x542C;&#x5668;</h3>
<h4 id="1-&#x8BBE;&#x7F6E;&#x7CFB;&#x7EDF;&#x84DD;&#x7259;&#x72B6;&#x6001;&#x76D1;&#x542C;">1. &#x8BBE;&#x7F6E;&#x7CFB;&#x7EDF;&#x84DD;&#x7259;&#x72B6;&#x6001;&#x76D1;&#x542C;</h4>
<p> &#x8BBE;&#x7F6E;&#x7CFB;&#x7EDF;&#x84DD;&#x7259;&#x72B6;&#x6001;&#x76D1;&#x542C;<a href="../api/QNBleApi.html#setsysblestatelistener">QNBleApi.setSysBleStateListener</a>,&#x83B7;&#x53D6;&#x624B;&#x673A;&#x7CFB;&#x7EDF;&#x84DD;&#x7259;&#x72B6;&#x6001;&#x3002;</p>
<h4 id="2&#x8BBE;&#x5907;&#x626B;&#x63CF;&#x8BBE;&#x5907;&#x76D1;&#x542C;">2.&#x8BBE;&#x5907;&#x626B;&#x63CF;&#x8BBE;&#x5907;&#x76D1;&#x542C;</h4>
<p> &#x8BBE;&#x5907;&#x626B;&#x63CF;&#x8BBE;&#x5907;&#x76D1;&#x542C;<a href="../api/QNBleApi.html#setbledevicediscoverylistener">QNBleApi.setBleDeviceDiscoveryListener</a>, &#x63A5;&#x6536;SDK&#x56DE;&#x4F20;&#x53D1;&#x73B0;&#x8BBE;&#x5907;&#x4FE1;&#x606F;&#x3002;</p>
<h4 id="3&#x8BBE;&#x7F6E;&#x84DD;&#x7259;&#x8FDE;&#x63A5;&#x53D8;&#x5316;&#x76D1;&#x542C;">3.&#x8BBE;&#x7F6E;&#x84DD;&#x7259;&#x8FDE;&#x63A5;&#x53D8;&#x5316;&#x76D1;&#x542C;</h4>
<p> &#x8BBE;&#x7F6E;&#x84DD;&#x7259;&#x8FDE;&#x63A5;&#x53D8;&#x5316;&#x76D1;&#x542C;<a href="../api/QNBleApi.html#setbleconnectionchangelistener">QNBleApi.setBleConnectionChangeListener</a>, &#x63A5;&#x6536;SDK&#x56DE;&#x4F20;&#x8BBE;&#x5907;&#x94FE;&#x63A5;&#x72B6;&#x6001;&#x53D8;&#x5316;&#x3002;</p>
<h4 id="4&#x8BBE;&#x7F6E;&#x84DD;&#x7259;&#x8FDE;&#x63A5;&#x53D8;&#x5316;&#x76D1;&#x542C;">4.&#x8BBE;&#x7F6E;&#x84DD;&#x7259;&#x8FDE;&#x63A5;&#x53D8;&#x5316;&#x76D1;&#x542C;</h4>
<p> &#x8BBE;&#x7F6E;&#x6D4B;&#x91CF;&#x6570;&#x636E;&#x76D1;&#x542C;<a href="../api/QNBleApi.html#setdatalistener">QNBleApi.setDataListener</a>,&#x63A5;&#x6536;SDK&#x56DE;&#x4F20;&#x6D4B;&#x91CF;&#x72B6;&#x6001;&#x4E0E;&#x6D4B;&#x91CF;&#x6570;&#x636E;&#x3002;</p>
<p>android &#x793A;&#x4F8B;&#xFF1A;</p>
<pre><code class="lang-java">QNBleApi mQNBleApi = QNBleApi.getInstance(<span class="hljs-keyword">this</span>);

mQNBleApi.setBleDeviceDiscoveryListener(<span class="hljs-keyword">new</span> QNBleDeviceDiscoveryListener() {
    <span class="hljs-meta">@Override</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> <span class="hljs-title">onDeviceDiscover</span><span class="hljs-params">(QNBleDevice qnBleDevice)</span> </span>{
      <span class="hljs-comment">//&#x626B;&#x63CF;&#x5230;&#x7684;&#x84DD;&#x7259;&#x8BBE;&#x5907;&#x56DE;&#x8C03;</span>
    }

    <span class="hljs-meta">@Override</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> <span class="hljs-title">onStartScan</span><span class="hljs-params">()</span> </span>{
      <span class="hljs-comment">//&#x542F;&#x52A8;&#x626B;&#x63CF;&#x6210;&#x529F;&#x56DE;&#x8C03;</span>
    }

    <span class="hljs-meta">@Override</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> <span class="hljs-title">onStopScan</span><span class="hljs-params">()</span> </span>{
      <span class="hljs-comment">//&#x505C;&#x6B62;&#x626B;&#x63CF;&#x540E;&#x56DE;&#x8C03;</span>
    }

    <span class="hljs-meta">@Override</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> <span class="hljs-title">onScanFail</span><span class="hljs-params">(<span class="hljs-keyword">int</span> i)</span> </span>{
      <span class="hljs-comment">//&#x626B;&#x63CF;&#x5931;&#x8D25;&#x56DE;&#x8C03;</span>
    }

    <span class="hljs-meta">@Override</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> <span class="hljs-title">onBroadcastDeviceDiscover</span><span class="hljs-params">(QNBleBroadcastDevice qnBleBroadcastDevice)</span> </span>{
      <span class="hljs-comment">//&#x5E7F;&#x64AD;&#x79E4;&#x8BBE;&#x5907;&#x76F8;&#x5173;&#x4FE1;&#x606F;&#x7684;&#x56DE;&#x8C03;</span>
    }

    <span class="hljs-meta">@Override</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> <span class="hljs-title">onKitchenDeviceDiscover</span><span class="hljs-params">(QNBleKitchenDevice qnBleKitchenDevice)</span> </span>{
      <span class="hljs-comment">//&#x53A8;&#x623F;&#x79E4;&#x8BBE;&#x5907;&#x76F8;&#x5173;&#x4FE1;&#x606F;&#x7684;&#x56DE;&#x8C03;</span>
    }
});

mQNBleApi.setBleConnectionChangeListener(<span class="hljs-keyword">new</span> QNBleConnectionChangeListener() {
    <span class="hljs-meta">@Override</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> <span class="hljs-title">onConnecting</span><span class="hljs-params">(QNBleDevice qnBleDevice)</span> </span>{
      <span class="hljs-comment">//&#x6B63;&#x5728;&#x8FDB;&#x884C;&#x8FDE;&#x63A5;&#x8BBE;&#x5907;&#xFF0C;&#x5728;&#x8C03;&#x7528;&#x8FDE;&#x63A5;&#x8BBE;&#x5907;&#x540E;&#xFF0C;&#x4F1A;&#x9A6C;&#x4E0A;&#x56DE;&#x8C03;</span>
    }

    <span class="hljs-meta">@Override</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> <span class="hljs-title">onConnected</span><span class="hljs-params">(QNBleDevice qnBleDevice)</span> </span>{
      <span class="hljs-comment">//&#x8BBE;&#x5907;&#x5DF2;&#x8FDE;&#x63A5;&#x6210;&#x529F;</span>
    }

    <span class="hljs-meta">@Override</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> <span class="hljs-title">onServiceSearchComplete</span><span class="hljs-params">(QNBleDevice qnBleDevice)</span> </span>{
      <span class="hljs-comment">//&#x8BBE;&#x5907;&#x7684;&#x670D;&#x52A1;&#x641C;&#x7D22;&#x5B8C;&#x6210;&#xFF0C;&#x6B63;&#x5E38;&#x60C5;&#x51B5;&#x4E0B;&#x4F1A;&#x5728; onConnected&#x540E;&#x9762;&#x8C03;&#x7528;</span>
    }

    <span class="hljs-meta">@Override</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> <span class="hljs-title">onDisconnecting</span><span class="hljs-params">(QNBleDevice qnBleDevice)</span> </span>{
      <span class="hljs-comment">//&#x6B63;&#x5728;&#x65AD;&#x5F00;&#x8FDE;&#x63A5;&#xFF0C;&#x8C03;&#x7528;&#x65AD;&#x5F00;&#x8FDE;&#x63A5;&#x65F6;&#xFF0C;&#x4F1A;&#x9A6C;&#x4E0A;&#x56DE;&#x8C03;</span>
    }

    <span class="hljs-meta">@Override</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> <span class="hljs-title">onDisconnected</span><span class="hljs-params">(QNBleDevice qnBleDevice)</span> </span>{
      <span class="hljs-comment">//&#x65AD;&#x5F00;&#x8FDE;&#x63A5;&#xFF0C;&#x65AD;&#x5F00;&#x8FDE;&#x63A5;&#x540E;&#x56DE;&#x8C03;</span>
    }

    <span class="hljs-meta">@Override</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> <span class="hljs-title">onConnectError</span><span class="hljs-params">(QNBleDevice qnBleDevice, <span class="hljs-keyword">int</span> i)</span> </span>{
      <span class="hljs-comment">//&#x51FA;&#x73B0;&#x4E86;&#x8FDE;&#x63A5;&#x9519;&#x8BEF;&#xFF0C;&#x9519;&#x8BEF;&#x7801;&#x53C2;&#x8003;&#x9644;&#x8868;</span>
    }
});

mQNBleApi.setDataListener(<span class="hljs-keyword">new</span> QNScaleDataListener() {
    <span class="hljs-meta">@Override</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> <span class="hljs-title">onGetUnsteadyWeight</span><span class="hljs-params">(QNBleDevice qnBleDevice, <span class="hljs-keyword">double</span> v)</span> </span>{
      <span class="hljs-comment">//&#x5B9E;&#x65F6;&#x4F53;&#x91CD;&#x6570;&#x636E;&#x56DE;&#x8C03;</span>
    }

    <span class="hljs-meta">@Override</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> <span class="hljs-title">onGetScaleData</span><span class="hljs-params">(QNBleDevice qnBleDevice, QNScaleData qnScaleData)</span> </span>{
      <span class="hljs-comment">//&#x7A33;&#x5B9A;&#x6570;&#x636E;&#x56DE;&#x8C03;</span>
    }

    <span class="hljs-meta">@Override</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> <span class="hljs-title">onGetStoredScale</span><span class="hljs-params">(QNBleDevice qnBleDevice, List&lt;QNScaleStoreData&gt; list)</span> </span>{
      <span class="hljs-comment">//&#x5B58;&#x50A8;&#x6570;&#x636E;&#x56DE;&#x8C03;</span>
    }

    <span class="hljs-meta">@Override</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> <span class="hljs-title">onGetElectric</span><span class="hljs-params">(QNBleDevice qnBleDevice, <span class="hljs-keyword">int</span> i)</span> </span>{
      <span class="hljs-comment">//&#x5145;&#x7535;&#x6B3E;&#x7684;&#x7535;&#x6C60;&#x7535;&#x91CF;&#x767E;&#x5206;&#x6BD4;&#x6570;&#x503C;&#x56DE;&#x8C03;</span>
    }

    <span class="hljs-meta">@Override</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> <span class="hljs-title">onScaleStateChange</span><span class="hljs-params">(QNBleDevice qnBleDevice, <span class="hljs-keyword">int</span> i)</span> </span>{
      <span class="hljs-comment">//&#x6D4B;&#x91CF;&#x8FC7;&#x7A0B;&#x4E2D;&#x7684;&#x8FDE;&#x63A5;&#x72B6;&#x6001;&#x56DE;&#x8C03;</span>
    }

    <span class="hljs-meta">@Override</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> <span class="hljs-title">onScaleEventChange</span><span class="hljs-params">(QNBleDevice qnBleDevice, <span class="hljs-keyword">int</span> i)</span> </span>{
      <span class="hljs-comment">//&#x79E4;&#x4E8B;&#x4EF6;&#x7684;&#x56DE;&#x8C03;</span>
    }
});
</code></pre>
<p>iOS &#x793A;&#x4F8B;&#xFF1A;</p>
<pre><code>//&#x8BBE;&#x7F6E;&#x4EE3;&#x7406;
QNBleApi *bleApi = [QNBleApi sharedBleApi];
bleApi.bleStateListener = self;
bleApi.discoveryListener = self;
bleApi.connectionChangeListener = self;
bleApi.dataListener = self;

//&#x5B9E;&#x73B0;&#x4EE3;&#x7406;&#x65B9;&#x6CD5;
- (void)onBleSystemState:(QNBLEState)state {
   //&#x7CFB;&#x7EDF;&#x84DD;&#x7259;&#x72B6;&#x6001;&#x7684;&#x56DE;&#x8C03;
}

- (void)onStartScan {
    //&#x5F00;&#x59CB;&#x626B;&#x63CF;&#x65F6;&#x56DE;&#x8C03;
}

- (void)onDeviceDiscover:(QNBleDevice *)device {
    //&#x53D1;&#x73B0;&#x8BBE;&#x5907;&#x65F6;&#x56DE;&#x8C03;
    //&#x53EF;&#x5728;&#x8BE5;&#x53D1;&#x56DE;&#x8C03;&#x8BBE;&#x5907;&#x540E;&#x5224;&#x65AD;&#x662F;&#x5426;&#x9700;&#x8981;&#x8FDE;&#x63A5;&#x8BE5;&#x8BBE;&#x5907;
}

- (void)onStopScan {
    //&#x505C;&#x6B62;&#x626B;&#x63CF;&#x65F6;&#x56DE;&#x8C03;
}

- (void)onConnecting:(QNBleDevice *)device {
    //&#x6B63;&#x5728;&#x8FDE;&#x63A5;&#x7684;&#x56DE;&#x8C03;
}

- (void)onConnected:(QNBleDevice *)device {
    // &#x8FDE;&#x63A5;&#x6210;&#x529F;&#x7684;&#x56DE;&#x8C03;
}

- (void)onDisconnected:(QNBleDevice *)device {
    //&#x8BBE;&#x5907;&#x65AD;&#x5F00;&#x8FDE;&#x63A5;
}

- (void)registerUserComplete:(QNBleDevice *)device user:(QNUser *)user {
   //&#x6CE8;&#x518C;&#x7528;&#x6237;&#x6210;&#x529F;&#x56DE;&#x8C03;&#x79E4;&#x7AEF;&#x7528;&#x6237;&#x4FE1;&#x606F;
   //APP&#x53EF;&#x5728;&#x8BE5;&#x65B9;&#x6CD5;&#x4E2D;&#x83B7;&#x53D6;&#x5230;&#x79E4;&#x5206;&#x914D;&#x7ED9;&#x7528;&#x6237;&#x7684;index,&#x4FDD;&#x5B58;&#x79E4;&#x7AEF;&#x7528;&#x6237;&#x4FE1;&#x606F;
}

- (void)onGetUnsteadyWeight:(QNBleDevice *)device weight:(double)weight {
    //&#x6536;&#x5230;&#x5B9E;&#x65F6;&#x6570;&#x636E;&#x56DE;&#x8C03;
}

- (void)onGetScaleData:(QNBleDevice *)device data:(QNScaleData *)scaleData {
   //&#x6536;&#x5230;&#x7A33;&#x5B9A;&#x6570;&#x636E;&#x56DE;&#x8C03;
}

- (void)onGetStoredScale:(QNBleDevice *)device data:(NSArray &lt;QNScaleStoreData *&gt; *)storedDataList {
    //&#x6536;&#x5230;&#x5B58;&#x50A8;&#x6570;&#x636E;&#x56DE;&#x8C03;
}

- (void)onScaleStateChange:(QNBleDevice *)device scaleState:(QNScaleState)state {
   //&#x79E4;&#x8FDE;&#x63A5;&#x6216;&#x6D4B;&#x91CF;&#x72B6;&#x6001;&#x53D8;&#x5316;&#x56DE;&#x8C03;
}
</code></pre><h3 id="2-&#x542F;&#x52A8;&#x626B;&#x63CF;">2. &#x542F;&#x52A8;&#x626B;&#x63CF;</h3>
<p>&#x5728;&#x786E;&#x8BA4;&#x84DD;&#x7259;&#x5DF2;&#x6253;&#x5F00;&#xFF0C;&#x5B89;&#x5353;&#x8FD9;&#x8FB9;&#x8FD8;&#x9700;&#x8981;&#x68C0;&#x67E5;&#x4E0B;<code>&#x5B9A;&#x4F4D;&#x6743;&#x9650;</code>&#x548C;<code>&#x5B9A;&#x4F4D;&#x5F00;&#x5173;</code>&#x3002;&#x5982;&#x679C;&#x786E;&#x8BA4;&#x84DD;&#x7259;&#x5DF2;&#x6253;&#x5F00;&#xFF0C;&#x5B9A;&#x4F4D;&#x6743;&#x9650;&#x5DF2;&#x6388;&#x6743;&#xFF0C;&#x5B9A;&#x4F4D;&#x670D;&#x52A1;&#x5F00;&#x5173;&#x5DF2;&#x6253;&#x5F00;&#xFF0C;&#x5219;&#x53EF;&#x4EE5;&#x5F00;&#x59CB;&#x84DD;&#x7259;&#x626B;&#x63CF;</p>
<blockquote>
<p>&#x5B89;&#x5353; 6.0 &#x4EE5;&#x540E;&#xFF0C;&#x5BF9; targetSdkVersion&gt;=23 &#x4EE5;&#x4E0A;&#x7684; APP&#xFF0C;&#x8FDB;&#x884C;&#x84DD;&#x7259;&#x626B;&#x63CF;&#x9700;&#x8981;&#x83B7;&#x53D6;&#x5B9A;&#x4F4D;&#x6743;&#x9650;&#xFF0C;&#x8BE6;&#x7EC6;&#x8BF4;&#x660E;&#x67E5;&#x770B;<a href="https://developer.android.com/guide/topics/connectivity/bluetooth-le" target="_blank">&#x5173;&#x4E8E;</a>
&#x5B9A;&#x4F4D;&#x670D;&#x52A1;&#x5F00;&#x5173;&#x4E0D;&#x662F;&#x5F3A;&#x5236;&#x6027;&#x7684;&#xFF0C;&#x4F46;&#x662F;&#x67D0;&#x4E9B;&#x624B;&#x673A;&#x4E0D;&#x6253;&#x5F00;&#x8FD9;&#x4E2A;&#x5F00;&#x5173;&#xFF0C;&#x4E5F;&#x65E0;&#x6CD5;&#x626B;&#x63CF;&#x5230;&#x8BBE;&#x5907;&#xFF0C;&#x8DDF;&#x5404;&#x5BB6;&#x7684;&#x624B;&#x673A;&#x7CFB;&#x7EDF;&#x76F8;&#x5173;</p>
<p>iOS13 &#x7CFB;&#x7EDF;&#x589E;&#x52A0;&#x4E86;&#x84DD;&#x7259;&#x4F7F;&#x7528;&#x6743;&#x9650;&#xFF0C;&#x9700;&#x8981;&#x68C0;&#x67E5;&#x662F;&#x5426;&#x6709;&#x4F7F;&#x7528;&#x6743;&#x9650;&#xFF0C;&#x786E;&#x8BA4;&#x5DF2;&#x6388;&#x6743;&#x5E76;&#x4E14;&#x84DD;&#x7259;&#x5DF2;&#x6253;&#x5F00;&#x7684;&#x60C5;&#x51B5;&#x4E0B;&#xFF0C;&#x5F00;&#x59CB;&#x626B;&#x63CF;</p>
</blockquote>
<p>&#x626B;&#x63CF;&#x65B9;&#x6CD5;&#x4E3A;<a href="../api/QNBleApi.html#startbledevicediscovery">QNBleApi.startBleDeviceDiscovery</a>&#xFF0C;&#x626B;&#x63CF;&#x5230;&#x7684;&#x8BBE;&#x5907;&#x6570;&#x636E;&#xFF0C;&#x4F1A;&#x5728;&#x4E0A;&#x9762;&#x8BBE;&#x7F6E;&#x7684;&#x626B;&#x63CF;&#x63A5;&#x53E3;&#x4E2D;<a href="../api/QNBleDeviceDiscoveryListener.html">QNBleDeviceDiscoveryListener</a>&#x56DE;&#x8C03;&#x3002;</p>
<p>&#x53E6;&#x5916;&#x6709;&#x5173;&#x626B;&#x63CF;&#x7684;&#x4E00;&#x4E9B;&#x7279;&#x6027;&#x8BBE;&#x7F6E;&#xFF0C;&#x53EF;&#x4EE5;&#x5728;<a href="../api/QNConfig.html">QNConfig</a>&#x8FDB;&#x884C;&#x8BBE;&#x7F6E;&#xFF0C;&#x9700;&#x8981;&#x8BBE;&#x7F6E;&#x7684;&#x5185;&#x5BB9;&#x5DF2;&#x57FA;&#x672C;&#x8986;&#x76D6;&#x3002;</p>
<blockquote>
<p>&#x901A;&#x5E38; APP &#x4F1A;&#x6709;&#x4E2A;&#x4E13;&#x95E8;&#x7528;&#x4E8E;&#x6D4B;&#x91CF;&#x7684;&#x754C;&#x9762;&#xFF0C;&#x6211;&#x4EEC;&#x4E00;&#x822C;&#x662F;&#x5728;&#x754C;&#x9762;&#x663E;&#x793A;&#x4E4B;&#x540E;&#x8FDB;&#x884C;&#x84DD;&#x7259;&#x626B;&#x63CF;&#xFF0C;&#x754C;&#x9762;&#x6D88;&#x5931;&#x7684;&#x65F6;&#x5019;&#x505C;&#x6B62;&#x626B;&#x63CF;&#x3002;</p>
</blockquote>
<p>android &#x793A;&#x4F8B;&#xFF1A;</p>
<pre><code class="lang-java">QNBleApi.getInstance(context).startBleDeviceDiscovery(<span class="hljs-keyword">new</span> QNResultCallback() {
            <span class="hljs-meta">@Override</span>
            <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> <span class="hljs-title">onResult</span><span class="hljs-params">(<span class="hljs-keyword">int</span> code, String msg)</span> </span>{
                <span class="hljs-comment">//&#x8BE5;&#x65B9;&#x6CD5;&#x5E76;&#x4E0D;&#x56DE;&#x5230;&#x8BBE;&#x5907;&#xFF0C;&#x800C;&#x662F;&#x8868;&#x793A;&#x626B;&#x63CF;&#x662F;&#x5426;&#x542F;&#x52A8;&#x6210;&#x529F;</span>
                <span class="hljs-keyword">if</span> (code != CheckStatus.OK.getCode()) {
                   ToastMaker.show(ScanActivity.<span class="hljs-keyword">this</span>,code+<span class="hljs-string">&quot;:&quot;</span>+msg);
                }
            }
        });
</code></pre>
<p>iOS &#x793A;&#x4F8B;:</p>
<pre><code>//&#x542F;&#x52A8;&#x626B;&#x63CF;
[[QNBleApi sharedBleApi] startBleDeviceDiscovery:^(NSError *error) {
    //&#x8BE5;&#x5904;&#x56DE;&#x8C03;&#x8868;&#x793A;&#x542F;&#x52A8;&#x626B;&#x63CF;&#x65B9;&#x6CD5;&#x662F;&#x5426;&#x6210;&#x529F;
    if (error) {
        NSLog([NSString stringWithFormat:@&quot;&#x542F;&#x52A8;&#x626B;&#x63CF;&#x65B9;&#x6CD5;&#x5931;&#x8D25;,&#x539F;&#x56E0;: %@&quot;,error]);
    }
}];
</code></pre><h3 id="&#x4E09;&#x3001;&#x8FDE;&#x63A5;&#x8BBE;&#x5907;&#x8BBF;&#x95EE;&#x6CE8;&#x518C;&#x6D4B;&#x91CF;">&#x4E09;&#x3001;&#x8FDE;&#x63A5;&#x8BBE;&#x5907;&#x8BBF;&#x95EE;/&#x6CE8;&#x518C;&#x6D4B;&#x91CF;</h3>
<h4 id="1&#x8FDE;&#x63A5;&#x8BBE;&#x5907;">1.&#x8FDE;&#x63A5;&#x8BBE;&#x5907;</h4>
<p>APP&#x5728;&#x6536;&#x5230;SDK&#x56DE;&#x8C03;&#x8BBE;&#x5907;&#x540E;&#xFF0C;&#x53EF;&#x4EE5;&#x5224;&#x65AD;&#x662F;&#x5426;&#x4E3A;&#x9700;&#x8981;&#x8FDE;&#x63A5;&#x7684;&#x8BBE;&#x5907;&#xFF08;&#x8FD9;&#x4E2A;&#x5C5E;&#x4E8E; APP &#x7684;&#x4E1A;&#x52A1;&#x903B;&#x8F91;&#xFF09;&#xFF0C;&#x901A;&#x8FC7;&#x8C03;&#x7528;<a href="../api/QNBleApi.html#connectuserscaledevice">QNBleApi.connectUserScaleDevice</a>&#x65B9;&#x6CD5;&#x6765;&#x5B9E;&#x73B0;&#x8FDE;&#x63A5;&#x8BBE;&#x5907;&#x3002;</p>
<p>&#x8FDE;&#x63A5;&#x8BBE;&#x5907;&#x65F6;,&#x5F53;<a href="../api/QNBleApi.html#connectuserscaledevice">QNBleApi.connectUserScaleDevice</a>&#x4F20;&#x9012;&#x53C2;&#x6570;<a href="../api/QNUser.html#index">QNUserScaleConfig.curUser.index</a>&#x7528;&#x6237;index&#x5927;&#x4E8E;0&#x65F6;SDK&#x4F1A;&#x8BA4;&#x4E3A;&#x672C;&#x6B21;&#x8FDE;&#x63A5;&#x8D70;&#x8BBF;&#x95EE;&#x6D4B;&#x91CF;&#x6D41;&#x7A0B;, &#x5F53;&#x7528;&#x6237;index&#x7B49;&#x4E8E;0&#x65F6;SDK&#x4F1A;&#x8BA4;&#x4E3A;&#x672C;&#x6B21;&#x8FDE;&#x63A5;&#x9700;&#x8981;&#x8D70;&#x6CE8;&#x518C;&#x6D4B;&#x91CF;&#x6D41;&#x7A0B;&#x3002;
&#x5F53;&#x7136;&#x4E5F;&#x53EF;&#x4EE5;&#x901A;&#x8FC7;&#x8BBE;&#x7F6E;<a href="../api/QNUserScaleConfig.html#isvisitor">QNUserScaleConfig.isVisitor</a>SDK&#x4F1A;&#x8BA4;&#x4E3A;&#x672C;&#x6B21;&#x6D4B;&#x91CF;&#x662F;&#x6E38;&#x5BA2;&#x8BBF;&#x95EE;&#x6D4B;&#x91CF;,&#x79E4;&#x7AEF;&#x4E0D;&#x4F1A;&#x4E3A;&#x7528;&#x6237;&#x5206;&#x914D;index&#x6CE8;&#x518C;&#x79E4;&#x7AEF;&#x7528;&#x6237;&#x3002;&#x4F20;&#x9012;&#x7684;&#x7528;&#x6237;&#x4FE1;&#x606F;&#x4EC5;&#x672C;&#x6B21;&#x6D4B;&#x91CF;&#x6709;&#x6548;&#x3002;</p>
<p>android &#x793A;&#x4F8B;&#xFF1A;</p>
<pre><code class="lang-java"><span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> <span class="hljs-title">onDeviceDiscover</span><span class="hljs-params">(QNBleDevice qnBleDevice)</span> </span>{
  <span class="hljs-comment">//&#x626B;&#x63CF;&#x5230;&#x7684;&#x84DD;&#x7259;&#x8BBE;&#x5907;&#x56DE;&#x8C03;</span>
  QNUserScaleConfig mQNUserScaleConfig= <span class="hljs-keyword">new</span> QNUserScaleConfig();
  mQNUserScaleConfig.setCurUser(qnUser);
  <span class="hljs-comment">//mQNUserScaleConfig.setVisitor(true);</span>
  mQNBleApi.connectUserScaleDevice(mBleDevice,mQNUserScaleConfig,mCallback);
}
</code></pre>
<p>iOS &#x793A;&#x4F8B;&#xFF1A;</p>
<pre><code>- (void)onDeviceDiscover:(QNBleDevice *)device {
    //&#x53D1;&#x73B0;&#x8BBE;&#x5907;&#x65F6;&#x56DE;&#x8C03;
    if (isConnect) {
        QNUserScaleConfig *config = userConfig;
        config.user.index = userIndex;
        config.user.secret = userSecret;
        //config.isVisitor = YSE;
        [[QNBleApi sharedBleApi] connectUserScaleDevice:device config:config callback:^(NSError *error) {
        }];
    }
}
</code></pre><p>&#x53E6;&#x5916;&#xFF0C;&#x8C03;&#x7528;&#x8FDE;&#x63A5;&#x524D;&#xFF0C;&#x6700;&#x597D;&#x628A;&#x4E4B;&#x524D;&#x7684;&#x626B;&#x63CF;&#x7ED9;&#x505C;&#x6B62;&#xFF08;&#x6211;&#x4EEC;&#x53D1;&#x73B0;&#x90E8;&#x5206;&#x624B;&#x673A;&#x540C;&#x65F6;&#x84DD;&#x7259;&#x626B;&#x63CF;&#x548C;&#x84DD;&#x7259;&#x8FDE;&#x63A5;&#xFF0C;&#x4F1A;&#x964D;&#x4F4E;&#x8FDE;&#x63A5;&#x6210;&#x529F;&#x7684;&#x5931;&#x8D25;&#x7387;&#xFF09;&#x3002;&#x505C;&#x6B62;&#x626B;&#x63CF;&#x540E;&#xFF0C;&#x5EF6;&#x8FDF;&#x4E2A; 200~500ms &#x518D;&#x8C03;&#x7528;&#x8FDE;&#x63A5;&#xFF0C;&#x4F1A;&#x63D0;&#x5347;&#x8FDE;&#x63A5;&#x7684;&#x6210;&#x529F;&#x7387;&#x3002;
&#x505C;&#x6B62;&#x84DD;&#x7259;&#x626B;&#x63CF;&#x7684;&#x65B9;&#x6CD5;&#x4E3A;&#xFF1A;<a href="../api/QNBleApi.html#stopbledevicediscovery">QNBleApi.stopBleDeviceDiscovery</a>&#x3002;</p>
<p>android &#x793A;&#x4F8B;&#xFF1A;</p>
<pre><code class="lang-java">QNBleApi.getInstance(context).stopBleDeviceDiscovery(<span class="hljs-keyword">new</span> QNResultCallback() {
    <span class="hljs-meta">@Override</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> <span class="hljs-title">onResult</span><span class="hljs-params">(<span class="hljs-keyword">int</span> code, String msg)</span> </span>{
        <span class="hljs-keyword">if</span> (code == CheckStatus.OK.getCode()) {
            isScanning = <span class="hljs-keyword">false</span>;
        }
    }
});
</code></pre>
<p>iOS &#x793A;&#x4F8B;&#xFF1A;</p>
<pre><code>[[QNBleApi sharedBleApi] stopBleDeviceDiscovery:^(NSError *error) {
    //&#x8BE5;&#x5904;&#x56DE;&#x8C03;&#x8868;&#x793A;&#x505C;&#x6B62;&#x626B;&#x63CF;&#x65B9;&#x6CD5;&#x662F;&#x5426;&#x6210;&#x529F;
    if (error) {
        NSLog([NSString stringWithFormat:@&quot;&#x505C;&#x6B62;&#x626B;&#x63CF;&#x65B9;&#x6CD5;&#x5931;&#x8D25;,&#x539F;&#x56E0;: %@&quot;,error]);
    }
}];
</code></pre><h4 id="2&#x6D4B;&#x91CF;&#x6570;&#x636E;">2.&#x6D4B;&#x91CF;&#x6570;&#x636E;</h4>
<p>&#x79F0;&#x91CD;&#x8FC7;&#x7A0B;&#x7684;&#x6570;&#x636E;&#x4EE5;&#x53CA;&#x72B6;&#x6001;&#x4F1A;&#x5728;&#x4E0A;&#x8FF0;&#x63D0;&#x5230;&#x7684;<a href="../api/QNScaleDataListener.html">QNScaleDataListener</a>&#x4E2D;&#x8FDB;&#x884C;&#x56DE;&#x8C03;</p>
<h4 id="3&#x6D4B;&#x91CF;&#x7ED3;&#x675F;">3.&#x6D4B;&#x91CF;&#x7ED3;&#x675F;</h4>
<p>&#x6536;&#x5230;&#x7A33;&#x5B9A;&#x6570;&#x636E;&#x540E;&#xFF08;&#x5373;&#x6536;&#x5230;<a href="../api/QNScaleDataListener.html#ongetscalesata">QNScaleDataListener.onGetScaleData</a>&#xFF09;&#x5373;&#x8868;&#x793A;&#x6D4B;&#x91CF;&#x5B8C;&#x6210;&#xFF0C;&#x5F53;&#x6D4B;&#x91CF;&#x5B8C;&#x6210;&#x540E;&#xFF0C;&#x8BBE;&#x5907;&#x4F1A;&#x81EA;&#x52A8;&#x65AD;&#x5F00;&#x8FDE;&#x63A5;&#x3002;</p>
<p>&#x81F3;&#x6B64;&#xFF0C;&#x8BBE;&#x5907;&#x7684;&#x57FA;&#x672C;&#x6D41;&#x7A0B;&#x5DF2;&#x7ECF;&#x8D70;&#x5B8C;&#xFF0C;APP &#x53EF;&#x4EE5;&#x5728;&#x6536;&#x5230;&#x7A33;&#x5B9A;&#x6570;&#x636E;&#x540E;&#x81EA;&#x884C;&#x4FDD;&#x5B58;&#x6570;&#x636E;&#x548C;&#x5C55;&#x793A;&#x6570;&#x636E;&#x3002;&#x6570;&#x636E;&#x6807;&#x51C6;&#x5224;&#x65AD;&#x53EF;&#x4EE5;&#x6211;&#x53F8;&#x7684;&#x65B9;&#x5F0F;-<a href="../attouched_list/SDK&#x6307;&#x6807;&#x6807;&#x51C6;&#x63CF;&#x8FF0;.pdf">SDK &#x6307;&#x6807;&#x6807;&#x51C6;&#x63CF;&#x8FF0;</a>&#x3002;</p>
<h3 id="&#x56DB;&#x3001;&#x84DD;&#x7259;wifi&#x53CC;&#x6A21;&#x79E4;&#x914D;&#x7F6E;&#x7F51;&#x7EDC;">&#x56DB;&#x3001;&#x84DD;&#x7259;WiFi&#x53CC;&#x6A21;&#x79E4;&#x914D;&#x7F6E;&#x7F51;&#x7EDC;</h3>
<p>&#x9488;&#x5BF9;&#x84DD;&#x7259;WiFi&#x53CC;&#x6A21;&#x79E4;&#x9664;&#x4E86;&#x4F7F;&#x7528;&#x84DD;&#x7259;&#x529F;&#x80FD;&#x9700;&#x8981;&#x5BF9;&#x63A5;SDK&#x5916;,&#x8FD8;&#x9700;&#x8981;&#x914D;&#x5408;&#x670D;&#x52A1;&#x5668;&#x96C6;&#x6210;<a href="https://github.com/YolandaQingniu/qn_wsp_full_server_doc/blob/main/README.zh-CN.md" target="_blank">Docker</a>&#x3002;</p>
<h4 id="1&#x8FDE;&#x63A5;&#x8BBE;&#x5907;">1.&#x8FDE;&#x63A5;&#x8BBE;&#x5907;</h4>
<p>APP&#x5728;&#x6536;&#x5230;SDK&#x56DE;&#x8C03;&#x8BBE;&#x5907;&#x540E;&#xFF0C;&#x53EF;&#x4EE5;&#x5224;&#x65AD;&#x662F;&#x5426;&#x4E3A;&#x9700;&#x8981;&#x8FDE;&#x63A5;&#x7684;&#x8BBE;&#x5907;&#x914D;&#x7F6E;&#x8BBE;&#x5907;WiFi&#xFF08;&#x8FD9;&#x4E2A;&#x5C5E;&#x4E8E; APP &#x7684;&#x4E1A;&#x52A1;&#x903B;&#x8F91;&#xFF09;&#xFF0C;&#x901A;&#x8FC7;&#x8C03;&#x7528;<a href="../api/QNBleApi.html#connectuserscaledevice">QNBleApi.connectUserScaleDevice</a>&#x65B9;&#x6CD5;&#x6765;&#x5B9E;&#x73B0;&#x8FDE;&#x63A5;&#x8BBE;&#x5907;&#x914D;&#x7F6E;WiFi&#x3002;</p>
<p>&#x8FDE;&#x63A5;&#x8BBE;&#x5907;&#x65F6;,&#x5F53;<a href="../api/QNBleApi.html#connectuserscaledevice">QNBleApi.connectUserScaleDevice</a>&#x4F20;&#x9012;&#x53C2;&#x6570;<a href="../api/QNWiFiConfig.html">QNUserScaleConfig.wifiConfig</a>&#x4E0D;&#x4E3A;nil&#x65F6;, SDK&#x4F1A;&#x8BA4;&#x4E3A;&#x672C;&#x6B21;&#x8FDE;&#x63A5;&#x9700;&#x8981;&#x8D70;&#x914D;&#x7F51;&#x6D41;&#x7A0B;&#x3002;
&#x5176;&#x4E2D;<a href="../api/QNUserScaleConfig.html#dataurl">QNUserScaleConfig.dataUrl</a>&#x4EE3;&#x8868;WiFi&#x6A21;&#x5F0F;&#x4E0B;&#x6D4B;&#x91CF;&#x6570;&#x636E;&#x4E0A;&#x4F20;&#x7684;&#x670D;&#x52A1;&#x5668;&#x5730;&#x5740;(&#x4E00;&#x822C;&#x662F;APP&#x540E;&#x53F0;&#x5730;&#x5740;), <a href="../api/QNUserScaleConfig.html#otaurl">QNUserScaleConfig.otaUrl</a>&#x4EE3;&#x8868;WiFi&#x6A21;&#x5F0F;&#x4E0B;OTA&#x56FA;&#x4EF6;&#x5730;&#x5740;&#x3002;
android &#x793A;&#x4F8B;&#xFF1A;</p>
<pre><code class="lang-java"><span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> <span class="hljs-title">onDeviceDiscover</span><span class="hljs-params">(QNBleDevice qnBleDevice)</span> </span>{
  <span class="hljs-comment">//&#x626B;&#x63CF;&#x5230;&#x7684;&#x84DD;&#x7259;&#x8BBE;&#x5907;&#x56DE;&#x8C03;</span>
  QNUserScaleConfig mQNUserScaleConfig= <span class="hljs-keyword">new</span> QNUserScaleConfig();
  QNWiFiConfig mWiFiConfig = <span class="hljs-keyword">new</span> QNWiFiConfig();
  mWiFiConfig.setSsid(wifiname);
  mWiFiConfig.setPwd(password);
  mWiFiConfig.setServeUrl(<span class="hljs-string">&quot;http://www.sample.com&quot;</span>);
  mQNUserScaleConfig.setWifiConfig(mWiFiConfig);
  mQNUserScaleConfig.setOtaUrl(<span class="hljs-string">&quot;http://www.sample.com&quot;</span>);
  mQNBleApi.connectUserScaleDevice(mBleDevice,mQNUserScaleConfig,mCallback);
}
</code></pre>
<p>iOS &#x793A;&#x4F8B;&#xFF1A;</p>
<pre><code>- (void)onDeviceDiscover:(QNBleDevice *)device {
    //&#x53D1;&#x73B0;&#x8BBE;&#x5907;&#x65F6;&#x56DE;&#x8C03;
    if (isConnect) {
        QNUserScaleConfig *config = [[QNUserScaleConfig alloc] init];
        config.wifiConfig = wifiConfig;
        config.dataUrl = @&quot;http://hostname:port/path/&quot;; //&#x6700;&#x5927;&#x957F;&#x5EA6;&#x4E3A; 128 &#x4E2A;&#x5B57;&#x8282;
        config.otaUrl     = @&quot;protocol://hostname[:port]/path/&quot;;//&#x6700;&#x5927;&#x957F;&#x5EA6;&#x4E3A; 128 &#x4E2A;&#x5B57;&#x8282;
        [[QNBleApi sharedBleApi] connectUserScaleDevice:device config:config callback:^(NSError *error) {
        }];
    }
}
</code></pre><h4 id="2&#x76D1;&#x542C;&#x56DE;&#x8C03;&#x914D;&#x7F51;&#x72B6;&#x6001;">2.&#x76D1;&#x542C;&#x56DE;&#x8C03;&#x914D;&#x7F51;&#x72B6;&#x6001;</h4>
<p>&#x914D;&#x7F51;&#x72B6;&#x6001;&#x4F1A;&#x5728;<a href="../api/QNScaleDataListener.html#onscalestatechange">QNScaleDataListener.onScaleStateChange:</a>&#x4E2D;&#x8FDB;&#x884C;&#x56DE;&#x8C03;.</p>
<pre><code class="lang-java"><span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> <span class="hljs-title">onScaleStateChange</span><span class="hljs-params">(QNBleDevice qnBleDevice, <span class="hljs-keyword">int</span> i)</span> </span>{
  <span class="hljs-comment">//&#x6D4B;&#x91CF;&#x8FC7;&#x7A0B;&#x4E2D;&#x7684;&#x8FDE;&#x63A5;&#x72B6;&#x6001;&#x56DE;&#x8C03;</span>
  <span class="hljs-keyword">switch</span> (bleStatus) {
            <span class="hljs-keyword">case</span> QNScaleStatus.STATE_WIFI_BLE_START_NETWORK:
                <span class="hljs-comment">//&#x5F00;&#x59CB;&#x914D;&#x7F51;</span>
                stateString = getResources().getString(R.string.start_set_wifi);
                btnString = getResources().getString(R.string.disconnected);
                <span class="hljs-keyword">break</span>;
            <span class="hljs-keyword">case</span> QNScaleStatus.STATE_WIFI_BLE_NETWORK_FAIL:
                <span class="hljs-comment">//&#x5F00;&#x59CB;&#x5931;&#x8D25;</span>
                stateString = getResources().getString(R.string.failed_to_set_wifi);
                btnString = getResources().getString(R.string.disconnected);
                <span class="hljs-keyword">break</span>;
            <span class="hljs-keyword">case</span> QNScaleStatus.STATE_WIFI_BLE_NETWORK_SUCCESS:
                <span class="hljs-comment">//&#x5F00;&#x59CB;&#x6210;&#x529F;</span>
                stateString = getResources().getString(R.string.success_to_set_wifi);
                btnString = getResources().getString(R.string.disconnected);
                <span class="hljs-keyword">break</span>;
        }
}
</code></pre>
<p>iOS &#x793A;&#x4F8B;&#xFF1A;</p>
<pre><code>- (void)onScaleStateChange:(QNBleDevice *)device scaleState:(QNScaleState)state {
   if (state == DeviceStyleWifiBleStartNetwork) {
       //&#x5F00;&#x59CB;&#x914D;&#x7F51;
   }else if (state == DeviceStyleWifiBleNetworkSuccess){
       //&#x914D;&#x7F51;&#x6210;&#x529F;
   }else if (state == DeviceStyleWifiBleNetworkFail){
       //&#x914D;&#x7F51;&#x5931;&#x8D25;
   }

}
</code></pre>
                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="kitchen_scale.html" class="navigation navigation-prev " aria-label="Previous page: 厨房秤">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="ble_ruler.html" class="navigation navigation-next " aria-label="Next page: 蓝牙围度尺">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"用户秤","level":"1.4.4","depth":2,"next":{"title":"蓝牙围度尺","level":"1.4.5","depth":2,"path":"flow/ble_ruler.md","ref":"flow/ble_ruler.md","articles":[]},"previous":{"title":"厨房秤","level":"1.4.3","depth":2,"path":"flow/kitchen_scale.md","ref":"flow/kitchen_scale.md","articles":[]},"dir":"ltr"},"config":{"plugins":["mermaid-gb3"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"mermaid-gb3":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"language":"zh","gitbook":"*"},"file":{"path":"flow/ble_user_scale.md","mtime":"2022-12-12T02:59:26.593Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2023-01-16T11:02:39.181Z"},"basePath":"..","book":{"language":"zh"}});
        });
    </script>
</div>

        
    
    <script src="../../gitbook/gitbook.js"></script>
    <script src="../../gitbook/theme.js"></script>
    
        
        <script src="../../gitbook/gitbook-plugin-mermaid-gb3/book/plugin.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    <script src="../../gitbook/gitbook-plugin-mermaid-gb3/mermaid/mermaid.min.js"></script>

    </body>
</html>

